package com.jetpackframework.room;

import androidx.sqlite.db.SupportSQLiteOpenHelper;

import net.sqlcipher.database.SQLiteDatabase;

public class SafeHelperFactory implements SupportSQLiteOpenHelper.Factory{
    private byte[] passphrase;
    public SafeHelperFactory(byte[] passphrase){
        this.passphrase = passphrase;
    }
    @Override
    public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
        SQLiteDatabase.loadLibs(configuration.context);
        return new Helper(configuration.context, configuration.name, configuration.callback, passphrase);
    }
}
